package com.zhaohanlin.start;

import org.junit.Test;

import javax.naming.Name;

/**
 * @author zhaohanlin
 */

public class CatTest1 {
    static class Employee {
        private Double sal;

        public Employee() {
            System.out.println("Employee()...");

        }

        public Double getSal() {
            return sal;
        }

        public void setSal(Double sal) {
            this.sal = sal;
        }
    }

    static class Manger extends Employee {
        private Double bonus;
        public Manger()

        {
            System.out.println("Manger()...");

        }

        public Double getBonus() {
            return bonus;
        }

        public void setBonus(Double bonus) {
            this.bonus = bonus;
        }

        public Double total() {
            return this.bonus + super.getSal();
        }
    }

    @Test
    public void total() {
        Manger zhaokai = new Manger();
        zhaokai.setSal(5000.2);
        zhaokai.setSal(100.1);
        System.out.println(zhaokai.total());
    }
}



